home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 4 / ETO Development Tools 4.iso / Essentials / Developer Essentials May91 / MPW Interfaces & Libraries 3.2 / AIncludes / Processes.a < prev    next >
Encoding:
Text File  |  1991-04-17  |  5.5 KB  |  207 lines  |  [TEXT/MPS ]

  1. ; Version: 1.20
  2. ; Created: Sunday, October 15, 1989
  3. ;
  4. ; File: Processes.a
  5. ;
  6. ; Assembler Interface to the Macintosh Libraries
  7. ; Copyright Apple Computer, Inc. 1989-90
  8. ; All Rights Reserved
  9. ;___________________________________________________________________________
  10.  
  11.     IF &TYPE('__IncludingProcesses__') = 'UNDEFINED' THEN
  12. __IncludingProcesses__    SET    1
  13.  
  14.  
  15. ;__________________________________________________________________________________
  16. ; Process Serial Number (PSN)
  17. ;__________________________________________________________________________________
  18. ; various reserved process serial numbers
  19. kNoProcess        EQU         0                         ; no process at all
  20. kSystemProcess    EQU         1                         ; the system
  21. kCurrentProcess   EQU         2                         ; the switched-in process
  22.  
  23. ; record definition
  24. ProcessSerialNumber    RECORD    0
  25. highLongOfPSN        DS.L    1            ; the upper half
  26. lowLongOfPSN        DS.L    1            ; the lower half
  27. size                EQU        *
  28.                     ENDR
  29.  
  30. ; record definition (old style definition)
  31. highLongOfPSN        EQU        0
  32. lowLongOfPSN        EQU        4
  33.  
  34. ;__________________________________________________________________________________
  35. ; parameter block passed in the _Launch trap.
  36. ;__________________________________________________________________________________
  37.  
  38. ; flags for launchControlFlags field
  39. launchContinue    EQU         $4000
  40. launchNoFileFlags EQU         $0800
  41. launchUseMinimum  EQU         $0400
  42. launchDontSwitch  EQU         $0200
  43. launchAllow24Bit  EQU         $0100
  44. launchInhibitDaemon EQU       $0080
  45.  
  46. ; format of buffer pointed to by launchAppParameters
  47. AppParameters            RECORD    0
  48. theMsgEvent                DS.B    $10            ; (evtBlkSize) a HighLevelEvent record
  49. eventRefCon                DS.L    1            ; refcon for the high-level event
  50. messageLength            DS.L    1            ; number of bytes in messageBuffer
  51. messageBuffer            EQU        *            ; start of message for the high level event
  52. size                    EQU        *
  53.                         ENDR
  54.  
  55. ; format of buffer pointed to by launchAppParameters (old style definition)
  56. theMsgEvent                EQU        0
  57. eventRefCon                EQU        16
  58. messageLength            EQU        20
  59. messageBuffer            EQU        24
  60.  
  61. ; parameter block itself
  62. LaunchParamBlockRec        RECORD    0
  63. reserved1                DS.L    1
  64. reserved2                DS.W    1
  65. launchBlockID            DS.W    1    ;    { = extendedBlock }
  66. launchEPBLength            DS.L    1    ;    { = extendedBlockLen }
  67. launchFileFlags            DS.W    1
  68. launchControlFlags        DS.W    1
  69. launchAppSpec            DS.L    1
  70. launchProcessSN            DS        ProcessSerialNumber
  71. launchPreferredSize        DS.L    1
  72. launchMinimumSize        DS.L    1
  73. launchAvailableSize        DS.L    1
  74. launchAppParameters        DS.L    1
  75. size                    EQU        *
  76. extendedBlockLen        EQU        size-launchFileFlags
  77.                         ENDR
  78.  
  79. ; parameter block itself (old style definition)
  80. launchBlockID     EQU         6
  81. launchEPBLength                EQU        8
  82. launchFileFlags   EQU         12
  83. launchControlFlags EQU        14
  84. launchAppSpec                EQU        16
  85. launchProcessSN                EQU        20
  86. launchPreferredSize            EQU        28
  87. launchMinimumSize            EQU        32
  88. launchAvailableSize            EQU        36
  89. launchAppParameters            EQU        40
  90. SIZEOF_LAUNCHPARAMBLOCKREC    EQU        44
  91. extendedBlockLen            EQU        SIZEOF_LAUNCHPARAMBLOCKREC - launchFileFlags
  92.  
  93. ; set launchBlockID to extendedBlock to specify that extensions exist
  94. ; set launchEPBLength to extendedBlockLen for compatibility
  95. extendedBlock                EQU        19523
  96.  
  97. ;__________________________________________________________________________________
  98. ; Definition of the information block returned by _GetProcessInformation.
  99. ;__________________________________________________________________________________
  100.  
  101. ; bits in the processMode field
  102. modeDeskAccessory EQU         $00020000
  103. modeMultiLaunch   EQU         $00010000
  104. modeNeedSuspendResume    EQU            $00004000
  105. modeCanBackground        EQU            $00001000
  106. modeDoesActivateOnFGSwitch    EQU            $00000800
  107. modeOnlyBackground        EQU            $00000400
  108. modeGetFrontClicks        EQU            $00000200
  109. modeGetAppDiedMsg        EQU            $00000100
  110. mode32BitCompatible        EQU            $00000080
  111. modeHighLevelEventAware        EQU            $00000040
  112. modeLocalAndRemoteHLEvents    EQU            $00000020
  113. modeStationeryAware            EQU            $00000010
  114. modeUseTextEditServices        EQU            $00000008
  115.  
  116. ; record returned by GetProcessInformation
  117. ProcessInfoRec        RECORD    0
  118. processInfoLength    DS.L    1
  119. processName            DS.L    1
  120. processNumber        DS        ProcessSerialNumber
  121. processType            DS.L    1
  122. processSignature    DS.L    1
  123. processMode            DS.L    1
  124. processLocation        DS.L    1
  125. processSize            DS.L    1
  126. processFreeMem        DS.L    1
  127. processLauncher        DS        ProcessSerialNumber;
  128. processLaunchDate    DS.L    1
  129. processActiveTime    DS.L    1
  130. processAppSpec        DS.L    1
  131. size                EQU        *
  132.                     ENDR
  133.                     
  134. ; record returned by GetProcessInformation (old style definition)
  135. processInfoLength EQU         0
  136. processName       EQU         4
  137. processNumber     EQU         8
  138. processType       EQU         16
  139. processSignature  EQU         20
  140. processMode       EQU         24
  141. processLocation   EQU         28
  142. processSize       EQU         32
  143. processFreeMem    EQU         36
  144. processLauncher   EQU         40
  145. processLaunchDate EQU         48
  146. processActiveTime EQU         52
  147. processAppSpec      EQU        56
  148.  
  149. ;__________________________________________________________________________________
  150. ; trap macros
  151. ;__________________________________________________________________________________
  152.  
  153.                   MACRO
  154.                   _LaunchApplication
  155.                   _Launch
  156.                   ENDM
  157.  
  158.                   MACRO
  159.                   _LaunchDeskAccessory
  160.                   MOVE.W      #$36,-(SP)
  161.                   _OSDispatch
  162.                   ENDM
  163.  
  164.                   MACRO
  165.                   _GetCurrentProcess
  166.                   MOVE.W      #$37,-(SP)
  167.                   _OSDispatch
  168.                   ENDM
  169.  
  170.                   MACRO
  171.                   _GetFrontProcess
  172.     PEA            $FFFFFFFF
  173.     MOVE.W        #$39,-(SP)
  174.     _OSDispatch
  175.                   ENDM
  176.  
  177.                   MACRO
  178.                   _GetNextProcess
  179.                   MOVE.W      #$38,-(SP)
  180.                   _OSDispatch
  181.                   ENDM
  182.  
  183.                   MACRO
  184.                   _GetProcessInformation
  185.                   MOVE.W      #$3A,-(SP)
  186.                   _OSDispatch
  187.                   ENDM
  188.  
  189.                   MACRO
  190.                   _SetFrontProcess
  191.                   MOVE.W      #$3B,-(SP)
  192.                   _OSDispatch
  193.                   ENDM
  194.  
  195.                   MACRO
  196.                   _WakeUpProcess
  197.                   MOVE.W      #$3C,-(SP)
  198.                   _OSDispatch
  199.                   ENDM
  200.  
  201.                   MACRO
  202.                   _SameProcess
  203.                   MOVE.W      #$3D,-(SP)
  204.                   _OSDispatch
  205.                   ENDM
  206.  
  207.     ENDIF    ; ...already included